package com.example.hospital.api.controller.form;

import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.*;

@Data
public class DoctorForm {
    @NotBlank(message = "name不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9\\u4e00-\\u9fa5]{1,20}$", message = "name内容不正确")
    private String name;

    @NotBlank(message = "pid不能为空")
//    @Pattern(regexp = "^[\\u4e00-\\u9fa5]{1,20}$", message = "name内容不正确")
    private String pid;

    @NotBlank(message = "sex不能为空")
    @Pattern(regexp = "^男$|^女$", message = "sex内容不正确")
    private String sex;


    @NotBlank(message = "birthday不能为空")
    @Pattern(regexp = "^[0-9]{4}-[0-9]{2}-[0-9]{2}$", message = "birthday内容不正确")
    private String birthday;

    @NotBlank(message = "school不能为空")
    @Length(min = 2, max = 50, message = "school内容不正确")
    private String school;

   @NotBlank(message = "tel不能为空")
    @Pattern(regexp = "^1[0-9]{10}$", message = "tel内容不正确")
    private String tel;

    @NotBlank(message = "address不能为空")
    @Length(max = 200, message = "address内容不正确")
    private String address;

    @NotBlank(message = "email不能为空")
    @Email
    @Length(max = 200, message = "email内容不正确")
    private String email;

//    @Min(value = 1, message = "deptId不能小于1")
//    private Integer deptId;

    @NotBlank(message = "degree不能为空")
    @Pattern(regexp = "^本科$|^研究生$|^博士$", message = "degree内容不正确")
    private String degree;

    @NotBlank(message = "job不能为空")
    @Pattern(regexp = "^主治医师$|^副主治医师$|^主任医师$|^副主任医师$", message = "job内容不正确")
    private String job;

    @NotNull(message = "remark不能为空")
    @Length(max = 50, message = "remark内容不正确")
    private String remark;

    @NotBlank(message = "description不能为空")
    private String description;

    @NotBlank(message = "hiredate不能为空")
    @Pattern(regexp = "^[0-9]{4}-[0-9]{2}-[0-9]{2}$", message = "hiredate内容不正确")
    private String hiredate;

    private String[] tag;

    @NotNull(message = "recommended不能为空")
    private Boolean recommended;

    @NotNull(message = "status不能为空")
    @Range(min = 1, max = 3, message = "status内容不正确")
    private byte status;

    @NotNull(message = "subId不能为空")
    @Min(value = 1, message = "subId不能小于1")
    private Integer subId;


}
